<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组操作</title>
</head>
<body>
       <select id="sltEmp">

       </select>
</body>
<script>
       /**
        *   如何 把 数据组中数据 赋值到 select /table 这样的结构上
        * */

      var employees = [
          {
              id:1,
              name:'Mat',
              gender:'male'
          },  {
              id:2,
              name:'Mary',
              gender:'female'
          }
      ]


      var emp1 = {
           id:3,
          name:'Tee'
      }
      /**
       *  for-i
       * */
   /*  for (var i=0;i<employees.length;i++){
         console.log(employees[i].name)
     } */

     /**
      *  for-in
      * */

    /* for(var index in employees){
         console.log(index);
         console.log(employees[index]);
     }*/

    /**
     * 对象遍历
     * */
    for(var key in emp1){
         console.log(key);
         console.log(emp1[key]);
    }


</script>
</html>